package com.controller;



import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.controller.base.BaseController;
import com.entity.ChanPing;
import com.entity.FuJian;
import com.entity.XinWenLanMu;
import com.entity.XinWenZiXun;
import com.entity.YongHuHangYe;
import com.service.CpService;
import com.service.FjService;
import com.service.UserIndustryService;
import com.service.XwlmService;
import com.service.XwzxService;


@Controller
@RequestMapping("/frontend/manager")
public class FrontEndController extends BaseController<Object> {
	@Autowired
	private XwlmService xwlmservice;
	@Autowired
	private XwzxService xwzxservice;
	@Autowired
	private UserIndustryService uiservice;
	@Autowired
	private FjService fjservice;
	@Autowired
	private CpService cpservice;
	
	@RequestMapping("/bzzx")
	public ModelAndView bzzx(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/bzzx");
		return mv;
	}
	@RequestMapping("/cpsc")
	public ModelAndView cpsc(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/cpsc");
		return mv;
	}
	@RequestMapping("/djcg")
	public ModelAndView djcg(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/djcg");
		return mv;
	}
	@RequestMapping("/djjgqy")
	public ModelAndView djjgqy(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/djjgqy");
		return mv;
	}
	@RequestMapping("/dl")
	public ModelAndView dl(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/dl");
		return mv;
	}
	@RequestMapping("/fwpj")
	public ModelAndView fwpj(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/fwpj");
		return mv;
	}

	@RequestMapping("/jsxz")
	public ModelAndView jsxz(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/jsxz");
		return mv;
	}
	
	@RequestMapping("/rzztqy")
	public ModelAndView rzztqy(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/rzztqy");
		return mv;
	}
	@RequestMapping("/sqjy")
	public ModelAndView sqjy(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/sqjy");
		return mv;
	}
	@RequestMapping("/xw")
	public ModelAndView xw(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/xw");
		return mv;
	}
	

	@RequestMapping("/zcztsyyh")
	public ModelAndView zcztsyyh(){
		ModelAndView mv =  new ModelAndView();
		mv.setViewName("FrontEnd/zcztsyyh");
		return mv;
	}
	@RequestMapping("/xwzx")
	public String xwzx(Model model){
		XinWenLanMu o=new XinWenLanMu();
		List<XinWenLanMu> xwlmlist=xwlmservice.finds(o);
		XinWenZiXun xwzx=new XinWenZiXun();
		xwzx.setId("3");
		List<XinWenZiXun> xwzxlist=xwzxservice.find(xwzx);
		model.addAttribute("xwlm",xwlmlist);
		System.out.println(xwzxlist.get(0));
		model.addAttribute("xwzx",xwzxlist.get(0));
		
		return "FrontEnd/xwzx";
	}
	@RequestMapping("/rzcp")
	public String rzcp(Model model){
		YongHuHangYe o=new YongHuHangYe();
		List<YongHuHangYe> cpfllist=uiservice.find(o);
		model.addAttribute("cpfl",cpfllist);
		return "FrontEnd/rzcp";
	}
	@RequestMapping("/zy")
	public String zy(Model model){
		FuJian o=new FuJian();
		List<FuJian> cpimg=fjservice.findimg(o);
		System.out.println(cpimg);
		model.addAttribute("cpimg",cpimg);
		return "FrontEnd/zy";
	}
	@RequestMapping("/xwxq")
	public String xwxq(Model model){
		XinWenZiXun o=new XinWenZiXun();
		XinWenZiXun xwzx=xwzxservice.findone(o);
		
		System.out.println("------------------"+xwzx);
		model.addAttribute("xw",xwzx);
		return "FrontEnd/xwxq";
	}
	@RequestMapping("/xgcp")
	public String xgcp(Model model){
		ChanPing o=new ChanPing();
		ChanPing cp=cpservice.findone(o);
		model.addAttribute("cp",cp);
		return "FrontEnd/xgcp";
	}
	@RequestMapping("/tjcp")
	public String tjcp(Model model){
		ChanPing o=new ChanPing();
		List<ChanPing> cpfllist=cpservice.find(o);
		model.addAttribute("cp",cpfllist);
		return "FrontEnd/tjcp";
	}
	@RequestMapping("/gywm")
	public String gywm(Model model){
		ChanPing o=new ChanPing();
		ChanPing cp=cpservice.findone(o);
		model.addAttribute("cp",cp);
		return "FrontEnd/gywm";
	}
	
}
